package it.marcomondini.proximitytools.receivers;

import it.marcomondini.proximitytools.ProxAlertActivity;
import it.marcomondini.proximitytools.facades.NotificationFacade;
import it.marcomondini.proximitytools.facades.PreferencesFacade;
import android.app.PendingIntent;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.location.Location;

public class BootReceiver extends BroadcastReceiver {

    @Override
    public void onReceive(Context ctx, Intent intent) {

	Location location = PreferencesFacade.getReferencePoint();

	PendingIntent pendingIntent = PendingIntent.getActivity(ctx, 0, new Intent(ctx, ProxAlertActivity.class), PendingIntent.FLAG_ONE_SHOT);

	NotificationFacade.instance().forward(ctx, 777, pendingIntent, "Device booted: " + location);
    }

}
